<?php
class Usermodel extends Kmodel {
	function submitlogin($login, $pwd) {
		$sql = "SELECT 	user_id, 
						user_name,
						user_login,
						last_login,
						user_type,
						user_timezone,
						user_email,
						user_phone 
				FROM k_user
				WHERE 	user_login = '".pg_escape_string($login)."' AND
						user_pwd = '".pg_escape_string(sha1($pwd))."'";
		$query = $this->db->query($sql);
		$nb_rows = $query->num_rows();
        if ($nb_rows < 1) {
            return NULL;
        } else {
            return $query->row_array();
        }
	}
}